package com.sgai.dcac.presenter;

import com.sgai.dcac.contract.LoginContract;
import com.sgai.dcac.data.model.LoginModel;
import com.sgai.dcac.ui.view.LoginView;

/**
 * Created by tony on 2017/6/14.
 */

public class LoginPresenter implements LoginContract.Presenter {

    private LoginView login;
    private LoginContract.Model model;

    public LoginPresenter(LoginView login) {
        this.login = login;
        model = new LoginModel();
    }

    @Override
    public void doLogin(String username, String password) {
        model.doLogin(username,password,this);
    }

    @Override
    public void success(String str) {
        login.success(str);
    }

    @Override
    public void failure(String str) {
        login.failure(str);
    }
}
